package com.zhkj.txg.module.order.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zhkj.txg.R

class OrderListTabAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_order_list_tab) {

    var selectedPosition = 0
        set(value) {
            if (field != value) {
                field = value
                notifyDataSetChanged()
            }
        }

    override fun convert(helper: BaseViewHolder, item: String) {
        helper.setText(R.id.tvOrderListTab, item).itemView.isSelected =
            helper.layoutPosition == selectedPosition
    }
}